<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:c="http://www.w3.org/1999/XSL/Transform">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>健康上报系统</title>
    <link rel="stylesheet" type="text/css" href="/css/a.css">
</head>
<body bgcolor="#ffebcd">
<h3>
    <form action="/userPage/index" method="post" th:align="right">
        <input type="submit" value="退出系统"/>
    </form>
    <a th:href="@{/admin/personList}">用户列表</a><br>
    <a th:href="@{/admin/getDate}">打卡数据</a><br>
    <a th:href="@{/admin/getTodayNotSubmit}">今天未打卡的人</a>
</h3>

<div>
    <form id="conditionForm" modelattribute="dynamicSql" action="/admin/selectByCondition" method="post">
        <span>姓名:</span>
        <input type="text" name="name" th:value="${dynamicSql.getName()}"/><br>
        <span>学号:</span>
        <input type="text" name="personId" th:value="${dynamicSql.getPersonId()}"/><br>
            <span>身份:</span>
            <select name="identity" th:value="${dynamicSql.getIdentity()}">
                <option value="">选择</option>
                <option th:selected="${dynamicSql.getIdentity() eq '大一'}" value="大一">大一</option>
                <option th:selected="${dynamicSql.getIdentity() eq '大二'}" value="大二">大二</option>
                <option th:selected="${dynamicSql.getIdentity() eq '大三'}" value="大三">大三</option>
                <option th:selected="${dynamicSql.getIdentity() eq '大四'}" value="大四">大四</option>
                <option th:selected="${dynamicSql.getIdentity() eq '教师'}" value="教师">教师</option>
            </select><br>
            <span>健康状况:</span>
            <select name="health" th:value="${dynamicSql.getHealth()}">
                <option value="">选择</option>
                <option th:selected="${dynamicSql.getHealth() eq '良好'}" value="良好">良好</option>
                <option th:selected="${dynamicSql.getHealth() eq '有咳嗽、发热症状'}" value="有咳嗽、发热症状">有咳嗽、发热症状</option>
                <option th:selected="${dynamicSql.getHealth() eq '体温异常，保持在37.3摄氏度以上'}" value="体温异常，保持在37.3摄氏度以上">体温异常，保持在37.3摄氏度以上</option>
            </select><br>
            <span>近14天是否到达过重点地区:</span>
            <select name="keyArea" th:value="${dynamicSql.getKeyArea()}">
                <option value="">选择</option>
                <option th:selected="${dynamicSql.getKeyArea() eq '是'}" value="是">是</option>
                <option th:selected="${dynamicSql.getKeyArea() eq '否'}" value="否">否</option>
            </select><br>
            <span>近14天是否接触过重点人群:</span>
            <select name="keyPeople" th:value="${dynamicSql.getKeyPeople()}">
                <option value="">选择</option>
                <option th:selected="${dynamicSql.getKeyPeople() eq '是'}" value="是">是</option>
                <option th:selected="${dynamicSql.getKeyPeople() eq '否'}" value="否">否</option>
            </select><br>
            <span>当天身体温度高于:</span>
            <input type="text" name="temperature" th:value="${dynamicSql.getTemperature()}" required="required"/><br>
            <span>打卡时间区间:</span>
            <input type="date" name="latestTime" th:value="${dynamicSql.getLatestTime()}"/> --
            <input type="date" name="laterTime" th:value="${dynamicSql.getLaterTime()}"/><br>
        <button onclick="submitConditionForm()">查询</button>
            <!--<input type="submit" value="查询"/>-->
    </form>
    <form modelattribute="dynamicSql" action="/admin/downloadInformation" method="post">
        <input type="text" name="name" th:value="${dynamicSql.getName()}" hidden="hidden"/>
        <input type="text" name="personId" th:value="${dynamicSql.getPersonId()}" hidden="hidden"/>
        <input type="text" name="identity" th:value="${dynamicSql.getIdentity()}" hidden="hidden"/>
        <input type="text" name="health" th:value="${dynamicSql.getHealth()}" hidden="hidden"/>
        <input type="text" name="keyArea" th:value="${dynamicSql.getKeyArea()}" hidden="hidden">
        <input type="text" name="keyPeople" th:value="${dynamicSql.getKeyPeople()}" hidden="hidden">
        <input type="text" name="temperature" th:value="${dynamicSql.getTemperature()}" hidden="hidden"/>
        <input type="text" name="latestTime" th:value="${dynamicSql.getLatestTime()}" hidden="hidden"/>
        <input type="text" name="laterTime" th:value="${dynamicSql.getLaterTime()}" hidden="hidden"/><br>
        <input type="submit" value="导出Excel表格"/>
    </form>
    <script>
        function submitConditionForm(){
            var form1 = document.getElementById('conditionForm');
            form1.submit();
        }
    </script>
</div>
<h1 align="center">打卡数据</h1>
<div >
    <table  border="1" cellspacing="0">
        <tr>
            <th>姓名</th>
            <th>学号/职工号</th>
            <th>证件类型</th>
            <th>证件号码</th>
            <th>身份</th>
            <th>联系电话</th>
            <th>籍贯</th>
            <th>家庭住址</th>
            <th>现在住址</th>
            <th>身体状况</th>
            <th>近14天是否到达过重点地区</th>
            <th>近14天是否接触过重点人群</th>
            <th>当天身体温度</th>
            <th>打卡时间</th>
        </tr>
        <tr th:each="var,rs:${informationList}">
            <td th:text="${rs.current.getName()}"></td>
            <td th:text="${rs.current.getPersonId()}"></td>
            <td th:text="${rs.current.getCdType()}"></td>
            <td th:text="${rs.current.getCdCard()}"></td>
            <td th:text="${rs.current.getIdentity()}"></td>
            <td th:text="${rs.current.getPhone()}"></td>
            <td th:text="${rs.current.getNativeCity()}"></td>
            <td th:text="${rs.current.getHomeAddress()}"></td>
            <td th:text="${rs.current.getNowAddress()}"></td>
            <td th:text="${rs.current.getHealth()}"></td>
            <td th:text="${rs.current.getKeyArea()}"></td>
            <td th:text="${rs.current.getKeyPeople()}"></td>
            <td th:text="${rs.current.getTemperature()}"></td>
            <td th:text="${rs.current.getTime().toString().replace('T',' ')}"></td>
        </tr>
    </table>
</div>
<br><br><br><br><br><br>
</body>
</html>
